package sms

import (
	"gitee.com/mootok/mootok/src/constant/config"
	"gitee.com/mootok/mootok/src/utils/logging"
)

var Instance Service

func init() {
	if config.EnvConfig.SmsServiceProvider == "ihuyi" {
		Instance = &IhuyiService{}
	} else if config.EnvConfig.SmsServiceProvider == "dummy" {
		Instance = &DummyService{}
	} else {
		logging.Logger.Warningf("Unknown sms provider \"%s\", use dummy instead.", config.EnvConfig.SmsServiceProvider)
		Instance = &DummyService{}
	}
}

type Service interface {
	Send(phone string, content string) error
}
